//
//  TrainingRecordItemStackView.swift
//  DaRings
//
//  Created by 魔样科技 on 2022/11/5.
//

import Foundation
import MYModule

open class TrainingRecordItemStackView: StackView {
    
    open override func makeUI() {
        super.makeUI()
  
        self.spacing = 4
        self.axis = .horizontal
        self.alignment = .center
        self.contentMode = .center
        
        self.addArrangedSubview(self.iconImageView)
        self.iconImageView.snp.makeConstraints { make in
            make.width.height.equalTo(10)
        }
        
        let stackView = StackView()
        stackView.axis = .horizontal
        
        stackView.addArrangedSubview(self.numLabel)
        stackView.addArrangedSubview(self.unitLabel)
        
        self.addArrangedSubview(stackView)
    }
    
    //MARK: - lazy load -
    public lazy var iconImageView: ImageView = {
        let imageView = ImageView()
        imageView.contentMode = .scaleAspectFit
        return imageView
    }()
    
    public lazy var numLabel: Label = {
        let label = Label()
        label.font = Fonts.systemFont(ofSize: 10)
        label.textColor = UIColor.assist_A9A9A9
        label.textAlignment = .center
        return label
    }()
    
    public lazy var unitLabel: Label = {
        let label = Label()
        label.font = Fonts.systemFont(ofSize: 10)
        label.textColor = UIColor.assist_A9A9A9
        label.textAlignment = .center
        return label
    }()
}
